package cn.jsj.cxsys.pojo;

import java.util.*;
import com.alibaba.fastjson.*;
import org.jetbrains.annotations.*;

public class LabMessage implements Comparable<LabMessage>
{
    private int messageID;
    private int result;
    private int studentID;
    private User student;
    private int teacherID;
    private String messageInf;
    private int labID;
    private Lab lab;
    private String responseInf;
    private String applyTime;
    private String replyTime;

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }
        final LabMessage that = (LabMessage)o;
        return this.messageID == that.messageID && this.studentID == that.studentID && this.teacherID == that.teacherID && this.labID == that.labID;
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.messageID);
    }

    public LabMessage() {
        this.messageID = 0;
        this.result = 0;
        this.studentID = 0;
        this.student = null;
        this.teacherID = 0;
        this.messageInf = null;
        this.labID = 0;
        this.lab = null;
        this.responseInf = null;
        this.applyTime = null;
        this.replyTime = null;
    }

    public int getMessageID() {
        return this.messageID;
    }

    public void setMessageID(final int messageID) {
        this.messageID = messageID;
    }

    public int getResult() {
        return this.result;
    }

    public void setResult(final int result) {
        this.result = result;
    }

    public int getStudentID() {
        return this.studentID;
    }

    public void setStudentID(final int studentID) {
        this.studentID = studentID;
    }

    public User getStudent() {
        return this.student;
    }

    public void setStudent(final User student) {
        this.student = student;
    }

    public int getTeacherID() {
        return this.teacherID;
    }

    public void setTeacherID(final int teacherID) {
        this.teacherID = teacherID;
    }

    public String getMessageInf() {
        return this.messageInf;
    }

    public void setMessageInf(final String messageInf) {
        this.messageInf = messageInf;
    }

    public int getLabID() {
        return this.labID;
    }

    public void setLabID(final int labID) {
        this.labID = labID;
    }

    public Lab getLab() {
        return this.lab;
    }

    public void setLab(final Lab lab) {
        this.lab = lab;
    }

    public String getResponseInf() {
        return this.responseInf;
    }

    public void setResponseInf(final String responseInf) {
        this.responseInf = responseInf;
    }

    public String getApplyTime() {
        return this.applyTime;
    }

    public void setApplyTime(String applyTime) {
        if (applyTime == null) {
            this.applyTime = null;
            return;
        }
        if (applyTime.contains(".")) {
            applyTime = applyTime.substring(0, applyTime.indexOf(46));
        }
        this.applyTime = applyTime;
    }

    public String getReplyTime() {
        return this.replyTime;
    }

    public void setReplyTime(String replyTime) {
        if (replyTime == null) {
            this.replyTime = null;
            return;
        }
        if (replyTime.contains(".")) {
            replyTime = replyTime.substring(0, replyTime.indexOf(46));
        }
        this.replyTime = replyTime;
    }

    @Override
    public String toString() {
        return JSON.toJSONString((Object)this);
    }

    @Override
    public int compareTo(@NotNull final LabMessage o) {
        if (this.result == 0 && o.result != 0) {
            return -1;
        }
        if (this.result == 0 && o.result == 0) {
            return this.studentID - o.studentID;
        }
        return o.messageID - this.messageID;
    }
}